package com.woniu.ucenterservice.service.imp;

import com.woniu.ucenterservice.dao.CtsMapper;
import com.woniu.ucenterservice.dao.TsMapper;
import com.woniu.ucenterservice.pojo.Cts;
import com.woniu.ucenterservice.pojo.Ts;
import com.woniu.ucenterservice.service.TsService;
import com.woniu.ucenterservice.vo.TsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TsServiceImp implements TsService {
    @Autowired
    private TsMapper tsMapper;
    @Autowired
    private CtsMapper ctsMapper;
    @Override
    public void addTs(Ts ts) {
        tsMapper.insert(ts);
    }

    @Override
    public List<Ts> selectTs(String tUser) {
        List<Ts> ts = tsMapper.selectByUsername(tUser);
        return ts;
    }

    @Override
    public Cts selectCts(Integer tid) {
        Cts cts = ctsMapper.selectByTid(tid);


        return cts;
    }

    @Override
    public List<Ts> selectAll(String tUser, Integer currentPage, Integer pageSize, TsVo tsVo) {
        List<Ts> ts = tsMapper.selectAllTs(tUser, currentPage, pageSize, tsVo);
        return ts;
    }
}
